Text File | 1989-03-01 | 568 b | 3 lines | [TEXT/ttxt]
Key messages
This stack by David Bogartz shows a quick and very dirty way to get HyperCard to send a message when the user presses a key (other than return, tab, and the arrow keys). It doesn't work for number keys, and it probably isn't right for some applications, but it's simple and will probably work in many cases. The basic idea is that there is an idle handler in the background script that looks in the message box and grabs whatever is there. Then, for each keystroke, it generates the event "key" with the character that the user pressed as a parameter.